package org.zt.java.dal.config.vo;

import org.springframework.util.StringUtils;
import org.zt.java.dal.datasource.DataSourceType;

public class MethodRouterConfig {

	public static String DEFAULT_METHOD = "*";
	public static String DEFAULT_PARAM = "[*]";
	
	private String className;
	private String method;
	private String param;
	private DataSourceType use;

	public MethodRouterConfig() {
		super();
	}

	public MethodRouterConfig(String className, String method,String param,
			DataSourceType use) {
		super();
		setClassName(className);
		setMethod(method);
		setParam(param);
		setUse(use);
	}

	public String getClassName() {
		return className;
	}

	public void setClassName(String className) {
		this.className = className;
	}

	public String getMethod() {
		return method;
	}

	public void setMethod(String method) {
		if(StringUtils.isEmpty(method)){
			this.method = DEFAULT_METHOD;
		}else{
			this.method = method;
		}
	}

	public DataSourceType getUse() {
		return use;
	}

	public void setUse(DataSourceType use) {
		this.use = use;
	}

	public String getParam() {
		return param;
	}

	public void setParam(String param) {
		if(StringUtils.isEmpty(param)){
			this.param = DEFAULT_PARAM;
		}else{
			this.param = param;
		}
	}
	

}
